import request from '@/utils/request'

export default {
  getPendingTasksList(pageNum, pageSize, status, dateRange) {
    if (dateRange===null || dateRange===undefined) {
      dateRange=[];
    }
    return request({
      url: `/pendingTasks/queryPendingTasks/${pageNum}/${pageSize}/${status}`,
      method: 'POST',
      data: dateRange
    })
  },

  getPendingTasksListById(id, status) {
    return request({
      url: `/pendingTasks/queryPendingTasksById/${id}/${status}`,
      method: 'GET',
    })
  },

  updatePendingTasksById(id, status, approvalInfo) {
    approvalInfo.approvalResult = Number(approvalInfo.approvalResult)
    return request({
      url: `/pendingTasks/updatePendingTasksById`,
      method: 'put',
      data: approvalInfo,
      params: {
        id: id,
        status: status,
      }
    })
  },

  getLeadersAll(userID){
    console.log("----->>>",userID)
    return request({
      url: `/pendingTasks/getLeadershipAll`,
      method: 'get',
      params: {userID: userID}
    })
  },
}
